def quickSort(arr):
    if len(arr) <= 1:
        return arr
    else:
        pivot = arr[0]
        left = []
        right = []
        for i in range(1, len(arr)):
            if arr[i] < pivot:
                left.append(arr[i])
            else:
                right.append(arr[i])
        return quickSort(left) + [pivot] + quickSort(right)


if __name__ == "__main__":
    arr = [19, 2, 31, 45, 6, 11, 121, 27]
    print("Original Array: ", arr)
    sortedArr = quickSort(arr)
    print("Sorted Array: ", sortedArr)
